(function($, doc) {
	mui.init();
	var userInfo = app.getState();
	var uid = userInfo.user_id;
	
	var player = document.createElement('audio');
	player.src = '../../static/sound/com.mp3';
	player.volume = 1;
	player.loop = true;
	player.play();
	$.plusReady(function(){
		var mainid = localStorage.getItem('mainpage');
		var mainWin = plus.webview.getWebviewById(mainid);
		var toid = plus.webview.currentWebview().toid;
		var toname = plus.webview.currentWebview().toname;
		var avatar = app.avatar(toid,'../../static/images/1.png');
		doc.getElementById('userimg').src = avatar;
		doc.getElementById('username').innerHTML = toname;
		document.getElementById("refused").addEventListener('tap', function(){
			player.pause();
			plus.webview.currentWebview().close();
			var msgInfo = {type : 'cutvideoMe', room_id : toid, toname : toname, uid : uid, name : userInfo.name};
			mui.fire(mainWin, 'cutvideoMe', msgInfo);
			
		});
		document.getElementById("changetovoice").addEventListener('tap', function(){
			player.pause();
			plus.webview.currentWebview().close();
		});
	});
	
	
}(mui, document));